//
//  MessageCollectionViewCell.m
//  ArtWalker
//
//  Created by Mac Jc on 15/8/3.
//  Copyright (c) 2015年 Mac Jc. All rights reserved.
//

#import "MessageCollectionViewCell.h"
#import "AllHeader.h"

@implementation MessageCollectionViewCell

- (void)dealloc
{
    [_textLabel release];
    [super dealloc];
}
//构造函数
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        [self creactView];
    }
    return self;
}
/**
 *  创建视图控件
 */
- (void)creactView
{
    _MessageBackgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH - 16, 60)];
    _MessageBackgroundView.backgroundColor = [UIColor whiteColor];
    _MessageBackgroundView.layer.cornerRadius = 5;
    
    //加阴影
    [UIView viewShadowColor:_MessageBackgroundView];
        
    [self.contentView addSubview:_MessageBackgroundView];
    
    _iconImage = [[UIImageView alloc] initWithFrame:CGRectMake(10, 15, 30, 30)];
    _iconImage.layer.cornerRadius = 15;
    _iconImage.layer.masksToBounds = YES;
    _iconImage.backgroundColor = kRandomColor;
    [_MessageBackgroundView addSubview:_iconImage];
    
    _textLabel = [[UILabel alloc] initWithFrame:CGRectMake(45, 7, 200, 30)];
    _textLabel.text = @"画的怎么样？^_^";
    _textLabel.font = [UIFont systemFontOfSize:12];
    [_MessageBackgroundView addSubview:_textLabel];
    
    _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(45, 25, 100, 30)];
    _nameLabel.text = @"Kailly";
    _nameLabel.font = [UIFont systemFontOfSize:12];
    [_MessageBackgroundView addSubview:_nameLabel];
    
}

@end
